home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue33 / clinic / RBCurU.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1997-12-09  |  1.4 KB  |  61 lines

  1. unit RBCurU;
  2.  
  3. interface
  4.  
  5. uses
  6.   Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   StdCtrls, ExtCtrls, RGroup, DBCtrls, Db, DBTables;
  8.  
  9. type
  10.   TForm1 = class(TForm)
  11.     RadioGroup1: TRadioGroup;
  12.     Button1: TButton;
  13.     NewRadioGroup1: TNewRadioGroup;
  14.     DataSource1: TDataSource;
  15.     Table1: TTable;
  16.     DBRadioGroup1: TDBRadioGroup;
  17.     DBNewRadioGroup1: TDBNewRadioGroup;
  18.     DBNavigator1: TDBNavigator;
  19.     DBText1: TDBText;
  20.     procedure Button1Click(Sender: TObject);
  21.   private
  22.     { Private declarations }
  23.   public
  24.     { Public declarations }
  25.   end;
  26.  
  27. var
  28.   Form1: TForm1;
  29.  
  30. implementation
  31.  
  32. {$R *.DFM}
  33.  
  34. procedure SetRadioGroupCursor(RG: TCustomRadioGroup; Cur: TCursor);
  35. var
  36.   Loop: Integer;
  37. begin
  38.   with RG do
  39.   begin
  40.     { Set Cursor property of the radio group itself... }
  41.     Cursor := Cur;
  42.     { ...and then loop through the radio buttons themselves }
  43.     for Loop := 0 to ControlCount - 1 do
  44.       if Controls[Loop] is TRadioButton then
  45.         TRadioButton(Controls[Loop]).Cursor := Cur
  46.   end
  47. end;
  48.  
  49. procedure TForm1.Button1Click(Sender: TObject);
  50. begin
  51.   { Set Cursor property of radio buttons in radio group }
  52.   SetRadioGroupCursor(RadioGroup1, crDrag);
  53.   { Set Cursor property of radio buttons in db radio group }
  54.   SetRadioGroupCursor(DBRadioGroup1, crSQLWait);
  55.   { Set Cursor property of new component }
  56.   NewRadioGroup1.Cursor := crDrag;
  57.   DBNewRadioGroup1.Cursor := crSQLWait
  58. end;
  59.  
  60. end.
  61.